import Vue from 'vue';
import frLang from 'vuetify/es5/locale/fr'
import minifyTheme from 'minify-css-string'
import IsDarkMode from './darkMode';

import Vuetify, {
  VApp,
  VAppBar,
  VAppBarNavIcon,
  VAlert,
  VAutocomplete,
  VAvatar,
  VBadge,
  VBanner,
  VBottomNavigation,
  VBottomSheet,
  VBreadcrumbs,
  VBreadcrumbsItem,
  VBreadcrumbsDivider,
  VBtn,
  VBtnToggle,
  VCalendar,
  VCalendarCategory,
  VCalendarDaily,
  VCalendarWeekly,
  VCalendarMonthly,
  VCard,
  VCardTitle,
  VCardSubtitle,
  VCardActions,
  VCardText,
  VCarousel,
  VCarouselItem,
  VCheckbox,
  VSimpleCheckbox,
  VChip,
  VChipGroup,
  VColorPicker,
  VColorPickerSwatches,
  VColorPickerCanvas,
  VContent,
  VCombobox,
  VCounter,
  VData,
  VDataIterator,
  VDataFooter,
  VDataTable,
  VEditDialog,
  VTableOverflow,
  VDataTableHeader,
  VSimpleTable,
  VVirtualTable,
  VVirtualScroll,
  VDatePicker,
  VDatePickerTitle,
  VDatePickerHeader,
  VDatePickerDateTable,
  VDatePickerMonthTable,
  VDatePickerYears,
  VDialog,
  VDivider,
  VExpansionPanels,
  VExpansionPanel,
  VExpansionPanelHeader,
  VExpansionPanelContent,
  VFileInput,
  VFooter,
  VForm,
  VContainer,
  VCol,
  VRow,
  VSpacer,
  VLayout,
  VFlex,
  VHover,
  VIcon,
  VImg,
  VInput,
  VItem,
  VItemGroup,
  VLabel,
  VLazy,
  VListItemActionText,
  VListItemContent,
  VListItemTitle,
  VListItemSubtitle,
  VList,
  VListGroup,
  VListItem,
  VListItemAction,
  VListItemAvatar,
  VListItemIcon,
  VListItemGroup,
  VMain,
  VMenu,
  VMessages,
  VNavigationDrawer,
  VOverflowBtn,
  VOverlay,
  VPagination,
  VSheet,
  VParallax,
  VPicker,
  VProgressCircular,
  VProgressLinear,
  VRadioGroup,
  VRadio,
  VRangeSlider,
  VRating,
  VResponsive,
  VSelect,
  VSkeletonLoader,
  VSlider,
  VSlideGroup,
  VSlideItem,
  VSnackbar,
  VSparkline,
  VSpeedDial,
  VStepper,
  VStepperContent,
  VStepperStep,
  VStepperHeader,
  VStepperItems,
  VSubheader,
  VSwitch,
  VSystemBar,
  VTabs,
  VTab,
  VTabItem,
  VTabsItems,
  VTabsSlider,
  VTextarea,
  VTextField,
  VTimeline,
  VTimelineItem,
  VTimePicker,
  VTimePickerClock,
  VTimePickerTitle,
  VToolbar,
  VToolbarItems,
  VToolbarTitle,
  VTooltip,
  VTreeview,
  VTreeviewNode,
  VWindow,
  VWindowItem,
  VCarouselTransition,
  VCarouselReverseTransition,
  VTabTransition,
  VTabReverseTransition,
  VMenuTransition,
  VFabTransition,
  VDialogTransition,
  VDialogBottomTransition,
  VFadeTransition,
  VScaleTransition,
  VScrollXTransition,
  VScrollXReverseTransition,
  VScrollYTransition,
  VScrollYReverseTransition,
  VSlideXTransition,
  VSlideXReverseTransition,
  VSlideYTransition,
  VSlideYReverseTransition,
  VExpandTransition,
  VExpandXTransition
} from 'vuetify/lib';

Vue.use(Vuetify,
  {
    components: {
      VApp,
      VAppBar,
      VAppBarNavIcon,
      VAlert,
      VAutocomplete,
      VAvatar,
      VBadge,
      VBanner,
      VBottomNavigation,
      VBottomSheet,
      VBreadcrumbs,
      VBreadcrumbsItem,
      VBreadcrumbsDivider,
      VBtn,
      VBtnToggle,
      VCalendar,
      VCalendarCategory,
      VCalendarDaily,
      VCalendarWeekly,
      VCalendarMonthly,
      VCard,
      VCardTitle,
      VCardSubtitle,
      VCardActions,
      VCardText,
      VCarousel,
      VCarouselItem,
      VCheckbox,
      VSimpleCheckbox,
      VChip,
      VChipGroup,
      VColorPicker,
      VColorPickerSwatches,
      VColorPickerCanvas,
      VContent,
      VCombobox,
      VCounter,
      VData,
      VDataIterator,
      VDataFooter,
      VDataTable,
      VEditDialog,
      VTableOverflow,
      VDataTableHeader,
      VSimpleTable,
      VVirtualTable,
      VVirtualScroll,
      VDatePicker,
      VDatePickerTitle,
      VDatePickerHeader,
      VDatePickerDateTable,
      VDatePickerMonthTable,
      VDatePickerYears,
      VDialog,
      VDivider,
      VExpansionPanels,
      VExpansionPanel,
      VExpansionPanelHeader,
      VExpansionPanelContent,
      VFileInput,
      VFooter,
      VForm,
      VContainer,
      VCol,
      VRow,
      VSpacer,
      VLayout,
      VFlex,
      VHover,
      VIcon,
      VImg,
      VInput,
      VItem,
      VItemGroup,
      VLabel,
      VLazy,
      VListItemActionText,
      VListItemContent,
      VListItemTitle,
      VListItemSubtitle,
      VList,
      VListGroup,
      VListItem,
      VListItemAction,
      VListItemAvatar,
      VListItemIcon,
      VListItemGroup,
      VMain,
      VMenu,
      VMessages,
      VNavigationDrawer,
      VOverflowBtn,
      VOverlay,
      VPagination,
      VSheet,
      VParallax,
      VPicker,
      VProgressCircular,
      VProgressLinear,
      VRadioGroup,
      VRadio,
      VRangeSlider,
      VRating,
      VResponsive,
      VSelect,
      VSkeletonLoader,
      VSlider,
      VSlideGroup,
      VSlideItem,
      VSnackbar,
      VSparkline,
      VSpeedDial,
      VStepper,
      VStepperContent,
      VStepperStep,
      VStepperHeader,
      VStepperItems,
      VSubheader,
      VSwitch,
      VSystemBar,
      VTabs,
      VTab,
      VTabItem,
      VTabsItems,
      VTabsSlider,
      VTextarea,
      VTextField,
      VTimeline,
      VTimelineItem,
      VTimePicker,
      VTimePickerClock,
      VTimePickerTitle,
      VToolbar,
      VToolbarItems,
      VToolbarTitle,
      VTooltip,
      VTreeview,
      VTreeviewNode,
      VWindow,
      VWindowItem,
      VCarouselTransition,
      VCarouselReverseTransition,
      VTabTransition,
      VTabReverseTransition,
      VMenuTransition,
      VFabTransition,
      VDialogTransition,
      VDialogBottomTransition,
      VFadeTransition,
      VScaleTransition,
      VScrollXTransition,
      VScrollXReverseTransition,
      VScrollYTransition,
      VScrollYReverseTransition,
      VSlideXTransition,
      VSlideXReverseTransition,
      VSlideYTransition,
      VSlideYReverseTransition,
      VExpandTransition,
      VExpandXTransition
    }
  });

let themes = {};
if (document.documentElement.dataset.theme)
{
  themes = JSON.parse(atob(document.documentElement.dataset.theme));
}

export default new Vuetify({
  lang: {
    locales: { frLang },
    current: document.documentElement.lang,
  },
  theme: {
    themes,
    dark: IsDarkMode(),
    options: {
      minifyTheme,
      customProperties: true,
    },
  }
});
